package org.example.controller;

import org.example.entity.Recruitmentrequirement;
import org.example.models.R;
import org.example.service.RecruitmentrequirementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/recruitmentrequirement")
public class RecruitmentrequirementControllere {
    @Autowired
    private RecruitmentrequirementService recruitmentrequirementService;
    @GetMapping("/selectByRequirementIdAndRecruiterId")
    public R<List<Recruitmentrequirement>> selectByRequirementIdAndRecruiterId(@RequestParam(value = "requirementid", required = false) String requirementid,
                                                                               @RequestAttribute("userId") String userId){
        String recruiterid = userId;
        List<Recruitmentrequirement> recruitmentrequirements = recruitmentrequirementService.selectByRequirementIdAndRecruiterId(requirementid, recruiterid);
        return R.success(recruitmentrequirements);
    }
}
